<template>
	<view class="item" @click="itemClick">
		<text>{{selsectTile}}</text> <u-icon :name="$parent.title=='title'?'arrow-up':'arrow-down'"
			color="#c8c9cc"></u-icon>

	</view>
</template>

<script>
	export default {
		name: "dropdown-item",
		props: ['title', 'options', 'value'],
		data() {
			return {
				status: false,
				selsectTile: this.title,
				// optionsList: this.options
			};
		},

		methods: {
			itemClick() {
				let data = {
					status: !this.status,
					title: this.title
				}
				this.status = !this.status
				this.$parent.selectOption(this.options, data)
			},
			fenleiClick(item) {
				this.selsectTile = item.name
				this.$emit('input', item.name)
			}
		}
	}
</script>

<style scoped lang="scss">
	.item {
		display: flex;
		align-items: center;

		text {
			padding-right: 8rpx;
			font-size: 26rpx;
		}
	}

	.dowMsk {
		position: absolute;
		background-color: #fff;
		top: 50rpx;
		left: 0rpx;
		width: 100%;
		z-index: 999;
		overflow: hidden;
		transition: all .3s linear;
	}
</style>